package cn.cxy.immersionbardemo

import android.os.Bundle
import android.util.TypedValue
import androidx.appcompat.app.AppCompatActivity
import com.gyf.immersionbar.ktx.immersionBar

open class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        initImmersionBar()
    }

    private fun initImmersionBar() {
        immersionBar {
            val typedValue = TypedValue()
            theme.resolveAttribute(R.attr.colorPrimary, typedValue, true)
            statusBarColor(typedValue.resourceId).autoStatusBarDarkModeEnable(true, 0.2f)
        }
    }
}